import { errorStatus, errorCode } from './error-code.js'

// 返回格式
export function formatErrorStatus(err) {
    const message = errorStatus[err.status] || ''
    return {
        code: err.status,
        message: message
    }
}

export function errorResponse(code) {
    const message = errorCode[code] || ''
    return {
        code: code,
        message: message
    } 
}